using UnityEngine;
using System.Collections;

public class RespawnEntityHandler : RespawnHandler {
	public float checkRadius = 1.0f;
	
	public override bool canSpawn(int spawnIndex) {
		Transform t = getPoint(spawnIndex).transform;
		
		Collider[] items = Physics.OverlapSphere(t.position, checkRadius);
		foreach (Collider c in items) {
			if (c.transform.parent != null
			&&  c.transform.parent.GetComponent<Entity>() != null) {
				return false;
			}
		}
		
		return true;
	}
}